<template>
  <div class="box">
    <div class="head-fixed">
      <div class="head">
        <div class="head-div">
          <img src="../assets/zjt2.png" alt="" class="back" @click="back()" />
        </div>
        <div class="head-search">我的推广</div>
      </div>
    </div>
    <div class="content">
      <div class="tuiguang">
        <span>公司推广</span>
        <mt-switch v-model="value"></mt-switch>
      </div>
      <div class="tuiguang">
        <span>职位推广</span>
      </div>
      <div class="block" v-for="item in list">
        <div class="block-top">
          <span>{{ item.job }}</span>
          <span style="position: relative; z-index: 50">当前排名：未上榜</span>
        </div>
        <div class="block-button">
          <div class="green">竞价</div>
          <div class="gray">关闭竞价</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { Switch } from 'mint-ui'
import Vue from 'vue'
export default {
  inject: ['reload'],
  name: 'spread',
  components: {Switch},
  created () {
    // created 在模板渲染成html前调用，即通常初始化某些属性值，然后再渲染成视图
  },
  mounted () {
    this.$http({
      method: 'get',
      url: Vue.prototype.AppURL + '/user/get/spread/consume/points'
    }).then(({data}) => {
      console.log(data, "=========")
    })
  },
  // data() 为变量赋值等
  data () {
    return {
      // status为用户身份，0是求职者，1是招聘者
      status: localStorage.status,
      value: false,
      list: [
        {
          job: 'web前端开发',
          company: '大连华企智源有限公司',
          pay: '3-5K',
          city: [{ name: '完工结算' }, { name: '下午茶' }],
          rqstd: [{ name: '高新区' }, { name: 'web前端' }, { name: '1-3年' }],
          type: 0
        },
        {
          job: 'web前端开发',
          company: '大连华企智源有限公司',
          pay: '6-8K',
          city: [{ name: '完工结算' }, { name: '下午茶' }],
          rqstd: [{ name: '高新区' }, { name: 'web前端' }, { name: '4-5年' }],
          type: 1
        }
      ]
    }
  },
  // methods 编写js函数
  methods: {
    back () {
      this.$router.go(-1) // 返回上一层
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
html,
body,
.tac,
.box,
.tab-left,
.tab-left .el-menu {
  height: 100%;
}

.box {
  width: 100%;
  background: rgb(248, 248, 248);
}
.head-fixed {
  width: 100%;
  height: 43px;
  position: fixed;
  z-index: 999;
}
.head {
  background: #3e63a8;
  color: #fff;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.back {
  width: 14px;
  height: 14px;
}
.head div img {
  width: 20px;
  height: 20px;
}
.head-search {
  box-sizing: border-box;
  flex: 1;
  text-align: center;
  font-size: 14px;
}
.content {
  position: relative;
  top: 43px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 20px;
}
.tuiguang{
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  /* background: #fff; */
  padding: 10px 0;
}
.block {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 20px 10px 10px;
  background: #fff;
  margin-bottom: 10px;
  display: flex;
  flex-flow: column;
  justify-content: space-between;
  border-radius: 10px;
  box-shadow: 2px 2px 5px #c7c7c7;
  position: relative;
}
.block .block-top {
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
}
.block-top span:first-child {
  color: #333;
  font-weight: 700;
}
.block-top span:last-child {
  color: #3e63a8;
}
.block-calss {
  width: 100%;
}
.block-class span {
  color: #757575;
  font-size: 10px;
  padding: 2px 0px;
  border-radius: 3px;
  margin-right: 10px;
}

.block-button {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
.block-button div {
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 5px;
  margin-right: 5px;
}
.blue {
  background: #3e63a8;
}
.green {
  background: #53ca67;
}
.gray {
  background: #c7c7c7;
}
</style>
